<?php include("db.inc"); ?>

<div id="container">
	<h1>Advice process</h1>

	<form method="post" id="customForm" action="advice_model.php">
		<div>
			<label for="budget">Budget</label>
			<input id="budget" name="budget" type="text" />
			<span id="budgetInfo">Whats your budget?</span>
		</div>
		<div>
			<label for="event">Event</label>
			<input id="event" name="event" type="text" />
			<span id="eventInfo">Valid Event please, you will need it to log in!</span>
		</div>
		<div>
			<label for="designer">Designer</label>
			<?php
				$stylists = mysql_query('SELECT * FROM stylists');
				while ($stylist = mysql_fetch_array($stylists)) {
					echo '<div id="designerInput">';
					echo '<p><input type="checkbox" id="checkbox" class="designer" rel="' . $stylist['price'] . '" name="stylists[]" value="' . $stylist['id'] . '">' . $stylist['username'] ." $". $stylist['price']."</p>";
					echo '</div>';
				}
				
				
			?>
			
			<div id="clear"></div>
			
			
			<div id="totalPrice"> Total Price: &nbsp;</div>
			<div class="total_amount"> </div>
			
			<div id="clear"></div>
		</div>
		<div>
			<input id="send" name="send" type="submit" value="Send" />
		</div>
	</form>
</div>
<script type="text/javascript" src="validate_advice.js"></script>
<script type="text/javascript" >
$(".designer").click(function() {
    var total = 0;
    $(".designer:checked").each(function() {
        total += parseInt($(this).attr("rel"), 10);
    });
    $('.total_amount').text('$' + total + ".00")
});
</script>